<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>数据视图</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!--标准mui.css-->
		<link rel="stylesheet" href="../../cssmui/mui.min.css">
		<!--App自定义的css-->

		<!-- <link rel="stylesheet" type="text/css" href="../css/app.css" /> -->
		<style>
			.chart {
				height: 500px;
				margin: 0px;
				padding: 0px;
			}
			
			h5 {
				margin-top: 30px;
				font-weight: bold;
			}
			
			h5:first-child {
				margin-top: 15px;
			}
		</style>
		<script src="../../libs/echarts.common.min.js"></script>
		<script src="../../mui/mui.min.js"></script>
		<script src="../../js/app.js"></script>
		<script src="../../js/jsondb.js"></script>
		<script src="chart/chartservices.js"></script>
		<script src="chart/ChartTA.js"></script>
		<script src="chart/ChartMA.js"></script>
		<script src="chart/ChartPR.js"></script>
		<script src="chart/ChartST.js"></script>

	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">图形分析</h1>
		</header>
		<div class="mui-content">

			<div class="mui-content-padded">			
				<div class="chart" id="Chart1"></div>
			</div>
		
		</div>

		<script>
			
			
			function afterPlusReady() {
			//console.log("cccccc")
				//console.log("slef\n"+JSON.stringify(_self))
				var self = _self;
				if (self.chart==null)
					self.chart = 'bxsu';
				mui.init();
				var cdata1 ;
				if(self.chart == 'bxsu') {
				//	console.log()
					var ar1 = queryTa(self.where1, self.where2);						
					cdata1 = getBar_xs_u(ar1);	
				} else if(self.chart == 'btam') {
					var ar1 = queryTa(self.where1, self.where2);
					cdata1 = getBar_ta_m(ar1);				
				} else if (self.chart == 'bxsm'){
					var ar1 = queryTa(self.where1, self.where2);						
					cdata1 = getBar_xs_m(ar1);				
				}else if (self.chart == 'pxsu'){
					var ar1 = queryTa(self.where1, self.where2);						
					cdata1 = getPie_xs_u(ar1);				
				}else if (self.chart == 'bstm'){
					var ar1 = querySt(self.where1, self.where2);						
					cdata1 = getBar_st_m(ar1);				
				}else if (self.chart == 'pstg'){
					var ar1 = querySt(self.where1, self.where2);						
					cdata1 = getPie_st_g(ar1);				
				}
				drawchart1(cdata1);
			}

			function drawchart1(cdata) {
				var cdiv = echarts.init(G('Chart1'));
				Q('.mui-title').innerHTML = cdata.title;
				cdiv.setOption(cdata.option);
			}

			
		</script>
	</body>

</html>